Good news for HISOFT BASIC users !!!
------------------------------------

For  all of those  who didn't know,  the major part of the  REPLAY4
editor was written using HISOFT BASIC.   Machine code routines were
written to provide the REPLAY commands needed.  These routines were
then linked to the BASIC binary file  to provide an extended set of 
BASIC commands for REPLAY.    Some of the most useful have been put
together to  form a more  compact library  that can be used by you.
To link REPLAY.BIN to the HBASLIB.BIN file found on your BASIC disc
simply  follow the  instructions provided in chapter  E-15  of your
BASIC manual, detailing the use of the BUILDLIB.TTP program.  Users
of POWER BASIC will need to upgrade  their compiler if they require
the use of these REPLAY extentions.

The following extra commands are provided :-


hifi        form:       hifi x%
----        -----       -------
Hifi sets the audio output mode of the system, either through
the monitor or through the REPLAY cartridge output socket.
For example,
                         'hifi 0'

will cause the tv or monitor to be selected.
Any value other than zero will select the REPLAY output mode.


frequency   form:       frequency f%
---------   -----       ------------
Frequency selects the sample and playback speed of the system.
The value passed to frequency should be in the range of 0 to 7 and
is the same as the value described in the REPLAY users handbook
detailing the BASIC routines.


listen		form:		listen
------		-----		------
The listen command causes any audio present on the REPLAY i/p
to be played out through currently selected output channel.    To
exit listen mode, press 'ESC' on the keyboard.


replay      form:       replay start&,end&,loop%
------      -----       ------------------------
The replay command plays a sample held in memory starting from
the long word address start& upto the long word address end&.  The
currently selected output frequency and channel are used. Pressing
the space bar will cause the sample to re-start.    Pressing 'ESC'
will stop the sample.  If loop% = 0 then the sample will terminate
normally, if loop%=1 or more then the sample will continue to loop
until the 'ESC' key is pressed.

e.g   replay start&,end&,0       ' play from start to end, no loop


sample		form:		last& = FNsample&(start&,end&)
------		-----		------------------------------
The sample command will digitise the signal on the cartridge
input and will start to deposit the sample at the address START&
and will continue until the END& address has been stored.    The
value returned by the function is the address of the last sample
made, hence if the 'ESC' key is pressed during sampling,     the
value returned will NOT be the same as END& (as it will if 'ESC'
is not pressed). During sampling, the input signal will be heard
through the currently selected audio channel.


trigger     form:	trig% = FNtrigger%(trigger_value%)
-------     -----       ----------------------------------
This call will wait for the signal present on the REPLAY i/p
to equal or exceed that of trigger_value%. The sensitivity value
should be between 0 and 127 inclusive. The value returned by the
function will indicate if the trigger was successful or not, I.E
if trig%=0 then the trigger was aborted by pressing the ESC key.
If trig% is any value other than 0, then the trigger was tripped
by the input signal.
e.g :-

	if FNtrigger%(trigval%) = 0 then
				print "Escape was pressed !"
		else
				print "Trigger was successful"
	end if


wipe        form:       wipe start&,end&
----        -----       ----------------
This useful command will fill the block of memory defined by
the values of start& and end& with the value 128.  This value is
approximately  the same as that  produced by a  REPLAY cartridge 
with no input connected to it.  Memory may be initialised before
use with  this command to  prevent spurious  RAM data from being
heard between samples or simply to erase samples in memory.



How to use the library.
-----------------------
After having linked the REPLAY.BIN file into the main  BASIC
library, the user must include a line of the form :-

		library "REPLAY"

near the start of the BASIC program.  This tells the compiler to
expect  some unusual  BASIC commands, and to look in the library
for them before causing a compiler error.  The commands will now
be available for use like any other BASIC keywords.

WARNING !!
----------

Although the frequencies of  40 and 50 Khz are now available,
They must  only be used when playing samples out  through the
cartridge port. Failure to notice this MAY cause the computer
to crash !!   The least that will happen is that the computer
will play the samples at a reduced speed to that intended.
